package com.offer;

/**
 * @Author: huangzhigao
 * @Date: 2023/3/4 15:48
 */
public class offer05 {
    public String replaceSpace(String s) {
        StringBuilder res = new StringBuilder();
        char[] chars = s.toCharArray();
        for (Character c : chars) {
            if (c == ' ') {
                res.append("%20");
            } else {
                res.append(c);
            }
        }
        return res.toString();
    }
}
